{include file="public/header" /}
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-body">
      <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
        <div class="layui-form-item">
          <label class="layui-form-label">标题</label>
          <div class="layui-input-inline">
            <input type="text" name="title" lay-verify="required" placeholder="请输入标题" value="{$item.title|default=''}" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-form-item ">
          <label class="layui-form-label">内容</label>
          <div class="layui-input-block">
            <textarea name="content" id="content" lay-verify="content" style="display: none;" autocomplete="off" class="layui-textarea">{$item.content|default=''}</textarea>
          </div>
        </div>
        <div class="layui-form-item layui-hide">
          <input type="text" name="id" value="{$item.id}" />
          <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="编辑">
        </div>
      </div>
    </div>
  </div>
</div>
<script>
layui.use(['layer', 'form', 'layedit'], function(){
  var $ = layui.$
          ,layedit = layui.layedit
          ,form = layui.form;

  // 文档编辑
  var content = layedit.build('content',{
    tool: ['strong','italic','underline','del','left','center','right','|','face','link','unlink','image']
    ,height: 450
  });
  /* 自定义验证规则 */
  form.verify({
    content: function( value ){
      return layedit.sync(content);
    }
  });
})
</script>
{include file="public/footer" /}